#include "console.h"

#include <framework/mvp.h>

namespace presenters
{
  Console::Console(models::Console *, QTextEdit *) :
    mDir(Direction_None)
  {
  }

  void Console::SetDirection(Direction Dir_)
  {
    models::Console * pModel = mvp::GetPresenterModel<models::Console>(this);
    QTextEdit       * pView  = mvp::GetPresenterView<QTextEdit>(this);

    mDir = Dir_;

    if (mDir == DirectionOutput)
      QObject::connect(pModel, SIGNAL(OnOutput(const QString &)), pView, SLOT(append(const QString &)));
  }
} // namesapce presenters